﻿using FluentNHibernate.Mapping;
using Konekcija.Core.Reporting.Dto.Application.Profiles;

namespace Konekcija.Core.Reporting.Mappings.Profiles
{
    public class CommunicationChannelTypeMap : ClassMap<CommunicationChannelType>
    {
        public CommunicationChannelTypeMap()
        {
            Schema("profile");
            Table("CommunicationChannelTypes");

            Id(x => x.Id).GeneratedBy.GuidComb().Not.Nullable();
            Map(x => x.Type).Nullable();
            Map(x => x.DateCreated).Nullable();

            HasMany(x => x.CommunicationChannels)
                .LazyLoad()
                .Inverse()
                .AsBag()
                .Key(k => k.Not.Nullable())
                .KeyColumn("CommunicationChannelTypeId");
            //.Fetch.Join();
        }
    }
}
